﻿<%template _header%>
<%namespace YouHP.Model%>
<%namespace YouHP.Model.Group%>
<%namespace YouHP.Utility%>

<div class="layout-cols2">
	
	<div class="col1">
	<%if IsPost%> <%template _msgbox%> <%else%>
	
	     
<div class="box"><div class="content">您的检索条件：<%if cond.AuthorName!=""%><b>作者：</b><font color="green">{cond.AuthorName}</font><%/if%>&nbsp;<%if cond.Title!=""%><b>标题：</b><font color="green">{cond.Title}</font><%/if%></div></div>
  
<%csharp%>TempUrl = ModuleCtrl.Header4("BBSTopics","检索结果",false,false); <%/csharp%>
{TempUrl}		
	<%if  TopicDataList.Count==0%>
	<h1>没有搜到相关结果!</h1>
	<%else%>
         <form method="post" action="" id="topicdata">  
    
				<table border="0px" cellpadding="0" cellspacing="0" class="topiclist">
				<tr style="height:30px;">
				    <td style="padding-left:20px;"><b>标题</b></td>
				    <td align="center"><b>作者</b></td>
				    <td align="center"><b>回复/人气</b></td>
				    <td align="center"><b>最后更新</b></td>
				</tr>
				<tbody>

				<%csharp%>
				string str="color_0";
				foreach(TopicInfo item in TopicDataList) { <%/csharp%>
				<tr style="height:40px" class="{str}">
				   
				    <td>&nbsp;&nbsp;
				    <%csharp%>if(IsModerator()) { <%/csharp%>
				    <input type="checkbox" id="topic{item.Id}" name="topicid" value="{item.Id}"/>
				    <%csharp%>}<%/csharp%>
				    
				    
				     <%csharp%>TempUrl = string.Format("/BBS/Topic.aspx?gid=" + GroupData.Id + "&tid=" + item.Id); <%/csharp%>
				    &nbsp;&nbsp;<a href="{GetUrl(TempUrl)}">
				    <font <%if item.TitleColor==1%>color="Green"<%else if item.TitleColor==2%>color="Red"<%else%>color=""<%/if%>>
				    <%if item.Title.Length<=20%>{item.Title}<%else%>{item.Title.Substring(0,20)}...<%/if%>
				    </font>
				    
				    </a>
				    &nbsp;<%if item.ShowLevel==Constants.TopicGroupTop%><img src="/support/alpha/images/bbsicon2.jpg" /><%/if%>
				          <%if item.IsBest==1%><img src="/support/alpha/images/is.gif" /><%/if%>
				    
				    
				    </td>
				    <%csharp%>TempUrl = "/Profile/Index.aspx?uid=" + item.PostUserId; <%/csharp%>
				    <td align="center"><a href="{GetUrl(TempUrl)}" target="_blank">{item.PostUserName}</a>
				        <br />{item.PostTime.ToString("yyyy-MM-dd")}</td>
				    <td align="center">{item.ReplyCount}/{item.Hits}</td>
				    <td align="center">
				        <%csharp%>if(item.LatestReplyUserId > 0) { <%/csharp%>
				        <%csharp%>TempUrl = "/Profile/Index.aspx?uid=" + item.LatestReplyUserId; <%/csharp%>
				        <a href="{GetUrl(TempUrl)}" target="_blank"><font style="color:green;">{item.LatestReplyUserName}</font></a>
				        <br /><%csharp%>TempUrl = item.LatestReplyTime.ToString("yyyy-MM-dd hh:mm") ;<%/csharp%>{TempUrl}
				        <%csharp%>} else{ <%/csharp%>
				         暂无更新
				         <%csharp%>} <%/csharp%>
				    </td>
				</tr>
    			<%csharp%>
    			if(str=="color_0") str="color_1";
					else str="color_0";
    			
    			}<%/csharp%>

    			</tbody>
				</table>
	
	     <%csharp%>if(IsModerator()) { <%/csharp%>
				
				
				<p style="padding:10px;">
				<select id="actiontype" name="actiontype" onchange="if(window.confirm('确认操作？')) _$('topicdata').submit();">
				<option value="-1" selected>管理选中的帖子</option>
				<option value="{Constants.TopicUp}">置顶</option>
				<option value="{Constants.TopicAddBest}">加精</option>
				<option value="{Constants.TopicDown}">取消置顶</option>
				<option value="{Constants.TopicDelBest}">取消加精</option>
				<option value="{Constants.SetTitleColor_Green}">标题加重显示（绿色）</option>
				<option value="{Constants.SetTitleColor_Red}">标题加重显示（红色）</option>
				<option value="{Constants.SetTitleColor_General}">取消标题加重显示</option>
				<option value="{Constants.TopicDel}">删除</option>
				</select>
				&nbsp;&nbsp;
				<select id="TopicSort" name="TopicSort" onchange="if(window.confirm('确认操作？')) _$('topicdata').submit();">
				<option value="" selected>分类选中的帖子</option>
		                <%csharp%>foreach(string item in TopicSortList) { <%/csharp%>
		                <option value="{item}">{item}</option>
                        <%csharp%>}<%/csharp%>
				</select>
				</p>
							
					
          <%csharp%>}<%/csharp%>
	     </form>
			
	<%/if%>	

<%csharp%>TempUrl = ModuleCtrl.Footer("BBSTopics"); <%/csharp%>
{TempUrl}


	  <div class="box">  
	  <div class="content" style="zoom:1;">
			<div style=" float:left;">
				<div class="pages">
					{PagingString}
				</div>
			</div>
        <div style="float:right;">
        <%csharp%> TempUrl = "/BBS/TopicAdd.aspx?gid=" + GroupData.Id; <%/csharp%>
        <a href="{this.GetUrl(TempUrl)}" ><img src="/support/alpha/images/newtopic.gif" /></a>
        </div>
        <div style="clear:both;"></div>	
        </div> 
     </div>	
     
  
    
<%/if%>		
	</div>
	
	<div class="col2">
<%csharp%>TempUrl = ModuleCtrl.Header4("TopicSearch","帖子检索",false,false); <%/csharp%>
{TempUrl}
<%csharp%> TempUrl = "/BBS/TopicListBySearch.aspx?gid=" + GroupData.Id; <%/csharp%>
<form id="searchTopic" method="get" action="{this.GetUrl(TempUrl)}">
<input type="hidden" value="{GroupData.Id}" id="gid"  name="gid"/>
<input type="hidden" name="DoSearch" value="1" />
<table class="topicsearchbox">
<tr>
<td align="right">作者：</td>
<td><input id="author" name="author" value="{cond.AuthorName}" /></td></tr>

 <tr><td align="right">标题：</td><td><input id="title" name="title" value="{cond.Title}" /></td></tr>
  <tr><td colspan="2" align="center">提示：输入其一或全部，标题支持模糊匹配</td></tr>
 <tr>
 <td colspan="2" align="center">
 <span  onmouseout="this.className='new_sbt'" onmouseover="this.className='new_sbt_h'" onclick="SubmitForm();" class="new_sbt">检索</span>
 </td>
 </tr>
</table>
</form>	
 <%csharp%>TempUrl = ModuleCtrl.Footer("TopicSearch"); <%/csharp%>
{TempUrl}
<script type="text/javascript">
function SubmitForm()
{
  var content = _$('author').value;
  var content2 = _$('title').value;
  if(content.length == 0 && content2.length == 0)
  {
     alert('请输入帖子标题或作者名！');
     return;
  }

  _$('searchTopic').submit();

}
</script>

	</div>
	
</div>

<%template _footer%>		
